using System.Collections.Generic;
using Abs.Core.DAL.EntityFramework;
using Abs.Core.Models.User;

namespace Abs.Core.DAL.SetUpDatabase
{
    internal partial class AbsInitializer
    {
        private IList<Role> IntializeLevels(AbsContext absContext)
        {
            var levels = new List<Role>
                         {
                             new Role {RoleId = (int) RoleEnum.User, Title = RoleEnum.User.ToString().ToLower()},
                             new Role {RoleId = (int) RoleEnum.Admin, Title = RoleEnum.Admin.ToString().ToLower()}
                         };
            levels.ForEach(level => absContext.Roles.Add(level));
            absContext.SaveChanges();

            return levels;
        }//end of private void IntializeLevels(AbsContext absContext)
    }//end of public partial class AbsInitializer
}//end of namespace ABS.DAL